home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7513 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: newshost.cyberramp.net!news
  2. From: sinan@cyberramp.net (John Noland)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help With Pointers
  5. Date: 27 Feb 1996 01:47:02 GMT
  6. Organization: Prose Software
  7. Message-ID: <4gtnqm$qn2@newshost.cyberramp.net>
  8. References: <4g67cj$6cv@hobbes.compusult.nf.ca> <4ggvnq$2bt@newshost.cyberramp.net> <danpop.825077898@rscernix>
  9. NNTP-Posting-Host: ramp3-15.cyberramp.net
  10. X-Newsreader: WinVN 0.99.5
  11.  
  12. In article <danpop.825077898@rscernix>, danpop@mail.cern.ch says...
  13. >>char   SGI_source[4];
  14. >>union {
  15. >>       char    d1[4];
  16. >>       float   d2;
  17. >>} dest;
  18. >>
  19. >>dest.d1[1] = SGI_source[2];
  20. >>dest.d2[2] = SGI_source[1];
  21. >      ^^
  22. >      ?? Should be d1
  23. >>
  24. >>or however the byte rotation needs to be done.
  25. >
  26. >Using a union for this purpose is a bit of overkill (and, as you just
  27. >proved, error prone :-), a pointer is all that is needed:
  28.  
  29. YIKES!! I knew there was a reason to be apprehensive about posting that.
  30. A disengagement error if I ever saw one. [disengage brain...type code...
  31. let the compiler do the dirty work...wait a minute...something's worng$#%$##]
  32. Sorry. Thanks Dan.
  33.  
  34. -John
  35.  
  36.